package com.chenfan.filestore.utils;

import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;

import java.util.List;

public class EasyExcelUtil {
   public static void writeExcel(String writeName, List<Object> list, String path){
       ExcelWriter excelWriter = EasyExcel.write(writeName)
               .withTemplate(path)
//               .registerConverter(new BigIntegerConverter())
//               .registerConverter(new ImageConverter(showPicture))
//               .registerConverter(new SqlDateConverter())
//               .registerConverter(new DoubleConverter())
               .build();
       WriteSheet writeSheet = EasyExcel.writerSheet().build();
       excelWriter.write(list,writeSheet);
       excelWriter.finish();
   }
}
